<template>
  <div class="dashboard-editor-container">
    <div class="clearfix">
      <PanThumb :image="avatar" style="float: left;">
        Your Roles: <span v-for="item in roles" :key="item" class="info-roles">{{ item }}</span>
      </PanThumb>

      <GithubCornor style="position: absolute; top: 0; border: 0; right: 0;"></GithubCornor>

      <div class="info-container">
        <span class="display_name">{{ name }}</span>
        <span style="font-size:20px;padding-top:20px;display:inline-block;">Editor's Dashboard</span>
      </div>
    </div>

    <div>
      <img src="@/assets/images/dashboard/te.png" class="emptyGif">
    </div>
  </div>
</template>

<script setup lang="ts">
import PanThumb from "@/components/PanThumb/index.vue"
import GithubCornor from "@/components/github-corner/index.vue"

import { useStore } from "@/store";
import { computed } from "vue";

const store = useStore()

const emptyGif = 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'

const url = import.meta.url
const avatarUrl = `/src${store.state.user.avatar}`
const avatar = new URL(avatarUrl, url).href

const name = computed(() => store.state.user.name)

const roles = computed(() => store.state.user.roles)
</script>

<style lang="scss" scoped>
.emptyGif {
  display: block;
  width: 45%;
  margin: 0 auto;
}

.dashboard-editor-container {
  background-color: #e3e3e3;
  min-height: 100vh;
  padding: 50px 60px 0px;

  .info-roles {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    display: block;
  }

  .info-container {
    position: relative;
    margin-left: 190px;
    height: 150px;
    line-height: 200px;

    .display_name {
      font-size: 48px;
      line-height: 48px;
      color: #212121;
      position: absolute;
      top: 25px;
    }
  }
}
</style>
